from . import db, BaseMixin
import datetime

class User(BaseMixin, db.Model):
	"""用户"""
	__tablename__ = 'users'
	name = db.Column(db.String(255), comment="姓名")
	sex = db.Column(db.String(125), comment="性别 male:男性 female:女性 secret:保密")
	avatar_image_url = db.Column(db.String(255), comment="头像图片地址")
	md5_password = db.Column(db.String(255), nullable=False, comment="md5加密密码")
	is_delete = db.Column(db.Boolean, default=False, comment="是否删除")

class UserLogin(BaseMixin, db.Model):
	"""用户登录表"""
	__tablename__ = 'user_logins'
	user_id = db.Column(db.BigInteger, db.ForeignKey('users.id'), nullable=False, comment="用户id")
	login_type = db.Column(db.String(125), nullable=False, comment="登录方式")
	unique_id = db.Column(db.String(255), nullable=False, unique=True, comment="登录unique_id")
